<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    div {
        background-color: pink;
        width: 100px;
        height: 200px;
        position: absolute;
        margin-top: 30px;
        margin-left: 20px;
    }
</style>

<body>
    <div>

    </div>
    <script>
        var div = document.querySelector('div');
        div.addEventListener('click', function (e) {
            var x = e.pageX - this.offsetLeft;
            var y = e.pageY - this.offsetTop;
            console.log(x, y)
        })
    </script>
</body>

</html>